Detection and mitigation of detrimental operating conditions during pumpjack pumping

ABSTRACT

A motor-driven pumpjack is operated continuously while receiving sensory feedback from one or more sensors. In response to feedback indicating a detrimental operating condition, and while continuing to operate the pumpjack, one or more speed adjustments are made to specific control periods within the motor pumping cycle. The automated control optimizes flow while reacting to detrimental and changing conditions.

TECHNICAL FIELD

This invention relates to detection and mitigation of detrimentaloperating conditions during pumpjack operation.

BACKGROUND

Reciprocating oil pumps are traditionally provided in the form of abeam-balanced pumpjack. Conventional pumpjacks provide a sinusoidalcharacteristic of reciprocating pumping motion dictated by geometry andpower transmission from a fixed speed prime mover. Other types ofpumping units, such as long stroke or hydraulically actuated pumpingunits, operate at a first constant speed during upstroke motion and at asecond constant speed during downstroke motion. Some pumpjack systemsare equipped with a complex sensor suite including downhole fluid-levelor pressure indicators, flow and no-flow sensors, vibration sensors,motor current sensors, and/or dynamometer card sensors (e.g., loadcells) for detecting an undesirable pump-off condition. A typical remedyfor pump-off is to decrease the pumping rate of the pumpjack (e.g., byadjustment of the gear ratios to extend the stroke length) until thepump-off condition disappears.

SUMMARY

This specification describes technologies related to systems and methodsfor pumpjack fluid pumping.

One aspect of the invention features a method of operating a pumpjackcontinuously over a sequence of two adjacent pump stroke cycles. Themethod includes energizing an electric motor to operate the pumpjackover a first pump stroke cycle (according to a first motor speed profileincluding a plurality of target motor speeds corresponding to each of aplurality of discrete control periods within the first pump strokecycle), receiving sensory feedback during the first pump stroke cyclefrom one or more sensors mounted to monitor at least one operatingcondition of the pumpjack (the sensory feedback including data collectedduring operation of the motor according to the first motor speedprofile), and detecting, while continuing to operate the pumpjack, adetrimental operating condition within the first pump stroke cycle basedon the sensory feedback. In response to the detection, the methodincludes determining one or more speed adjustment values correspondingto a limited subset of the plurality of discrete control periods,altering the first motor speed profile based on the one or moreadjustment values to provide a second motor speed profile, and operatingthe electric motor over a second pump stroke cycle, according to thesecond motor speed profile.

In some examples, the first motor speed profile is a predetermineddefault setting. In some examples, the first motor speed profile is analtered version of a motor speed profile utilized in a previous pumpstroke cycle of the sequence. The plurality of discrete control periodsof the first pump stroke cycle preferably includes at least 100 controlperiods. In some cases, one or more (or all) of the plurality ofdiscrete control periods of the first pump stroke cycle have a timeduration of between about 5 and 100 milliseconds. In some examples, eachof the discrete control periods have an identical time duration.

In some embodiments, at least one of the sensors is a load sensor, suchas a load cell sensor responsive to load of a rod (e.g., a polish rod)of the pumpjack. In some examples, at least one of the sensors is acrank rotation sensor, or a motor shaft position sensor, or a motorcurrent sensor.

In some examples, detecting the detrimental operating condition includesconstructing a data structure relating position to load with respect toa polish rod of the pumpjack over the first pump stroke cycle based onthe sensory feedback. The the detrimental operating condition may bedetected by comparing the data structure to one or more predeterminedload limits, such as a load limit corresponds to the structuralintegrity of the polish rod, or to the structural integrity of a gearbox coupled to the motor and the polish rod, for example. In someexamples, the detrimental operating condition is identified byidentifying an abrupt load spike based on the data structure. The datastructure may include a dynamometer surface card and/or a downhole pumpcard, for example.

In some examples, determining the one or more speed adjustment valuesincludes selecting a speed adjustment value to increase the target motorspeed at a control period within the second pump stroke cycle precedingor subsequent to a different control period where the detrimentaloperating condition is likely to reoccur, or selecting a speedadjustment value to decrease the target motor speed at a control periodwithin the second pump stroke cycle where the detrimental operatingcondition is likely to reoccur, or selecting a speed adjustment value todecrease the target motor speed at a control period within the secondpump stroke cycle preceding a different control period where thedetrimental operating condition is likely to reoccur.

The electric motor may include a regenerative drive, such that themethod further includes providing a breaking torque to control thedescent of a rod system of the pumpjack during a downstroke of each ofthe pump stroke cycles, while simultaneously converting kinetic energyof the rod system into electrical power.

Another aspect of the invention features a method of operating apumpjack including operating an electric motor of a pumpjack to pumpfluid, according to a predetermined motor speed profile including aplurality of target motor speeds corresponding to each of a plurality ofdiscrete control periods within a stroke cycle of the pumpjack, whilereceiving sensory feedback including data collected from one or moresensors mounted to monitor at least one operating condition of thepumpjack. The predetermined motor speed profile corresponds to anoptimized stroke timing curve determined during one or more previousstroke cycles of the pumpjack. While continuing to operate the electricmotor to pump fluid, the method includes increasing one or more of theplurality of target motor speeds over a plurality of stroke cycles untila detrimental operating condition is detected based on sensory feedback,and in response to detecting the detrimental operating condition, and asthe pumpjack continues to pump fluid, decreasing a subset of theplurality of target motor speeds selected based on a position of thedetected detrimental operating condition within the stroke cycle.

Various examples of the method according to this aspect of the inventioninclude one or more features discussed above with respect to the firstaspect.

In some embodiments, incrementally increasing selected ones of theplurality of target motor speeds includes incrementally increasing eachof the plurality of target motor speeds according to a predeterminedadjustment schedule.

In some examples, the detrimental operating condition is detected byconstructing a data structure relating position to load with respect toa polish rod of the pumpjack over the stroke cycle based on the sensoryfeedback, and comparing the data structure to one or more predeterminedload limits, such as a load limit corresponding to the structuralintegrity of the polish rod or of a gear box coupled to the motor andthe polish rod.

In some examples, the detrimental operating condition is detected byconstructing a data structure relating position to load with respect toa polish rod of the pumpjack over the stroke cycle based on the sensoryfeedback, and identifying an abrupt load spike based on the datastructure.

In some examples, decreasing the subset of the plurality of target motorspeeds includes decreasing the target motor speed at one or more controlperiods preceding a different control period where the detrimentaloperating condition is likely to reoccur, or decreasing the target motorspeed at the control period where the detrimental operating condition islikely to reoccur.

Yet another aspect of the invention features a pumpjack motor systemincluding an electric motor coupled to a gear box of a pumpjack, one ormore sensors mounted to monitor at least one operating condition of thepumpjack, and a local controller coupled to the electric motor and theone or more sensors. The local controller is operable, while thepumpjack continuously pumps fluid, to control the motor according to afirst motor speed profile including a plurality of target motor speedscorresponding to each of a plurality of discrete control periods withina single stroke cycle of the pumpjack, receive sensory feedback from theone or more sensors (the sensory feedback including data, including loaddata, collected during operation of the motor according to the firstmotor speed profile), automatically increment a first set of the targetmotor speeds corresponding to portions of the stroke cycle outside of apredetermined load limit, based on the load data, and to automaticallydecrement a second set of the target motor speeds corresponding toportions of the stroke cycle within the predetermined load limit,thereby generating a second motor speed profile, and to then control themotor according to the second motor speed profile.

In some examples, the controller is configured to identify portions ofthe stroke cycle outside of the predetermined load limit by constructinga data structure relating position to load with respect to a polish rodof the pumpjack over the stroke cycle based on the sensory feedback, andcomparing the data structure to the predetermined load limit. In someexamples, the predetermined load limit corresponds to the structuralintegrity of the polish rod, or of a gear box coupled to the motor andthe polish rod.

In some examples, the electric motor includes a regenerative driveconfigured to provide a breaking torque to control the descent of a rodsystem of the pumpjack during a downstroke of each stroke cycle, whilesimultaneously converting kinetic energy of the rod system intoelectrical power.

Yet another aspect of the invention features a pumpjack motor system,including an electric motor coupled to a gear box of a pumpjack, one ormore sensors mounted to monitor at least one operating condition of thepumpjack, and a local controller coupled to the electric motor and theone or more sensors. The local controller is operable, while thepumpjack continuously pumps fluid over two sequential pumping cycles, tocontrol the electric motor through a first of the two sequential pumpingcycles, according to a first motor speed profile including a pluralityof target motor speeds corresponding to respective portions of thepumpjack stroke cycle, and while receiving sensory feedback from the oneor more sensors. The local controller is also operable to detect adetrimental operating condition within the first pump stroke cycle basedon the sensory feedback, and in response to the detection, automaticallyadjust one or more of the target motor speeds as a function of thesensory feedback, to generate an adjusted motor speed profile. The localcontroller then controls the motor according to the adjusted motor speedprofile during the second of the two sequential pumping cycles of thepumpjack.

In some examples, the first motor speed profile is a predetermineddefault setting. In some examples, the first motor speed profile is analtered version of a motor speed profile utilized in a previous pumpstroke cycle of the sequence.

Yet another aspect of the invention features a method of pumping fluid.The method includes operating an electric motor of a pumpjack to pumpfluid, according to a predetermined motor speed profile including aplurality of target motor speeds corresponding to each of a plurality ofdiscrete pump stroke cycle segments, while receiving load data from oneor more sensors mounted to monitor at least one operating condition ofthe pumpjack. The method also includes storing and updating a pumpstroke cycle load profile based on the received load data over a periodof several pump stroke cycles, and in response to detecting load datadeviating from the load profile by more than a predetermined deviationthreshold, automatically decrementing a subset of the plurality oftarget motor speeds selected based on a position of the deviating loaddata within the stroke cycle.

The detected load data deviation may be indicative of a rod load spike,or of a pump-off condition, for example. The detected load datadeviation may also be indicative of a gearbox torque transfer anomaly.

In some examples, the pump stroke cycle load profile is a data structurerelating position to load with respect to a polish rod of the pumpjackover one or more of the pump stroke cycles based on the sensoryfeedback. In some cases, the method includes detecting the load datadeviation by comparing the data structure to one or more predeterminedload limits, such as a load limit corresponding to the structuralintegrity of the polish rod or of a gear box coupled to the motor andthe polish rod.

Various examples of methods or systems corresponding to one or more ofthe described aspects of the invention discussed herein mayadvantageously provide optimized pump operation by detecting andautomatically mitigating various detrimental operating conditions, suchas pump off, rod binding, acute rod stress or excessive gearbox torque.Such conditions may be without user interaction mitigated or preventedwithout user intervention, by automatically adjusting the motor speedthroughout the pump stroke cycle. These detection and mitigationtechniques may be conducted by a local controller in essentially realtime, without employing computationally complex mathematical operations,resulting in relatively quick responses times (e.g., within one cycle orless), without interruption of the pumping process.

The details of one or more implementations of the subject matterdescribed in this specification are set forth in the accompanyingdrawings and the description below. Other features, aspects, andadvantages of the subject matter will become apparent from thedescription, the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view of a pumpjack in accordance with one or moreembodiments of the present disclosure.

FIG. 2 is a graph illustrating a default stroke cycle compared to anadjusted stroke cycle.

FIG. 3 is diagram illustrating the modification of a default motor speedprofile to provide an adjusted motor speed profile.

FIG. 4 is a graph illustrating a technique of operating a pumpjack thatincludes monitoring a surface dynamometer card and a downhole pump cardto detect a pump-off condition.

FIG. 5 is a graph illustrating a technique of operating a pumpjack thatincludes monitoring a surface dynamometer card to detect a rod binding.

FIG. 6 is a graph illustrating a technique of operating a pumpjack thatincludes monitoring a surface dynamometer card to detect a rod stresslimit.

FIG. 7 is a graph illustrating a technique of operating a pumpjack thatincludes monitoring a surface dynamometer card to detect a gearboxtorque limit.

FIG. 8 is a graph illustrating the progressive modification of apumpjack stroke cycle in response to varying motor speeds.

FIGS. 9A-9E are graphs illustrating the progressive modification ofpumpjack stroke cycle according to an iterative tuning process.

FIG. 10 is a flow chart illustrating a first method of operating apumpjack in accordance with one or more embodiments of the presentdisclosure.

FIG. 11 is a flow chart illustrating a second method of operating apumpjack in accordance with one or more embodiments of the presentdisclosure.

FIG. 12 is a flow chart illustrating a third method of operating apumpjack in accordance with one or more embodiments of the presentdisclosure.

FIG. 13 is a graph illustrating a varying voltage profile determinedbased on a varying motor torque profile.

FIG. 14 is a flow chart illustrating a fourth method of operating apumpjack in accordance with one or more embodiments of the presentdisclosure.

FIG. 15 is a graph illustrating a technique of operating a pumpjack thatincludes monitoring a surface dynamometer card and altering the stroketiming of the motor to increase fluid production while avoiding gearboxtorque limits.

Many of the features are exaggerated to better show the features,process steps, and results.

DETAILED DESCRIPTION

One or more implementations of the present disclosure include pumpjacksand pumpjack motor systems, as well as techniques for operating thesame, where the controller facilitates tuning and adaptation of thestroke timing by dynamically (e.g., on a stroke cycle interval basis)adjusting motor RPM to optimize a broad set of configurable parameters,including overall system efficiency and various stress conditions. Insome examples, the controller can be implemented by a moderately capablelocal processor, so as to avoid exceedingly complex mathematicalcomputations that may delay adjustment of the stroke timing. In someexamples, the controller utilizes a combination of mathematicallypredictive and partially predictive empirical (e.g., Perturb-now andObserve-later) algorithms for dynamic stroke-timing modification.

Referring first to FIG. 1, a pumpjack 100 includes a frame 102(sometimes referred to as a “Sampson post”), a walking beam 104, ahorsehead 106, a polish rod 108, and a pump 110. The frame 102 issupported on a substantially flat base 112. The walking beam 104 ispivotally coupled (e.g., journaled) to the crest of the frame 102. Thehorsehead 106 is coupled to a front end of the walking beam 104, andtherefore moves vertically upward and downward as the walking beam 104pivots about the frame 102. The polish rod 108 is coupled to thehorsehead 106 by a cable 114 (sometimes referred to as a “bridal”) andextends downward therefrom to project into the wellbore 10. The curvedface of the horsehead 106 ensures that the polish rod 108 is lowered andraised in a straight line. The pump 110 is located towards the bottom ofthe wellbore 10, coupled to the polish rod 108 by an intervening suckerrod 116. Although depicted in FIG. 1 as a single component, the suckerrod 116 may be provided as a string of multiple rod segments coupled toone another in an end-to-end arrangement. In some embodiments, the pump110 includes two valves and a plunger contained within a tubular pumpbarrel. During the “upstroke” of the pump—that is, when the plunger ispulled upward by the sucker rod 116—the top valve (sometimes referred toas the “riding valve”) closes and the bottom valve (sometimes referredto as the “standing valve”) opens. Fluid in the portion of the pumpbarrel above the riding valve is drawn upward with the plunger, and thebottom portion of the pump barrel is simultaneously filled with fluidthat enters the bottom of the wellbore 10 via perforations that havemade through the surrounding casing. During the “downstroke” of the pump110—that is, when the plunger is pushed downward by the sucker rod116—the riding valve opens and the standing valve closes, which allowsfluid from the bottom portion of the pump barrel to flow through theriding valve. An upstroke-downstroke pair is referred to as a “strokecycle.”

The rod system (e.g., the polish rod 108 and the sucker rod 116) carriesa continuously varying load due to the reciprocating motion of thehorsehead 106 and the associated fluid movement of the pump 110. Themaximum load occurs shortly after the beginning of the upstroke, whenthe riding valve closes. The polish rod 108 must carry the full weightof the fluids, the rod system, and the added inertial effects that occuras the motion of the rods is reversed. The minimum load occurs shortlyafter the beginning of the downstroke, as the riding valve opens. Atthat point, the rod system no longer carries the fluid load and theinertial effects are reversed, thereby reducing the total rod load belowthe weight of the rods and the produced fluids. The rod systemcontinuously stretches and contracts in response to the varying load. Inaddition, because of the elasticity of the sucker rod 116, which isusually of substantial length (e.g., over 5,000 ft.), large stress wavesrun up and down the rod in response to the various applied forces (e.g.,the above described loads, as well as mechanical and fluid friction).These stress waves may cause the sucker rod 116 to break if they becomeexcessive.

The walking beam 104 is driven by powertrain assembly including a primemover 118, a reduction gearbox 120, and a piloting shaft 122 (sometimesreferred to as a “Pitman arm”). The prime mover 118 drives the gearbox120 through a belt system (not shown). The gearbox 120 imparts rotarymotion into the proximal end of the piloting shaft 122 via a rotatingcrank 123. The distal end of the piloting shaft 122 is coupled to a rearend of the walking beam 104, and rocks the walking beam 104 back andforth in a pivoting motion about the frame 102, thus moving thehorsehead 106 up and down as described above. In this example, the freeend of the rotating crank 123 carries a counterweight 124, which atleast partially offsets the weight of the rods (e.g., the polish rod 108and sucker rod 116) and fluid to assist the prime mover 118 during theupstroke of the pump 110, and provides substantial resistance againstthe prime mover 118 to inhibit freefall of the rod system and pump 110during the downstroke.

In this example, the prime mover 118 is provided in the form of anelectrical induction motor (e.g., a high efficiency Nema B motor)operated by a variable frequency drive (“VFD”) 126. The VFD 126regulates the speed and torque output of the prime mover 118 by varyinginput frequency and voltage. In some embodiments, the VFD 126 includesappropriate hardware and circuitry (e.g., processors, memory, and I/Ocomponents) to regulate the speed and torque output based on one or moresetpoint values. A controller 128 communicatively coupled to the VFD 126includes appropriate hardware and circuitry (e.g., processors, memory,and I/O components) so as to achieve any of the control operationsdescribed herein. For example, the controller 128 may be configured toprovide a target motor speed and/or a target motor torque setpoint tothe VFD 126. In some implementations, the controller 128 may beimplemented locally with the VFD 126 (e.g., fully or partiallyintegrated therewith) or located at a remote location with communicationbetween the components being conducted across a wired or wireless link(e.g., wired radio, the Internet, wireless cellular network, telephonenetwork or satellite communication). In some examples, the prime mover118 is further equipped with a regenerative drive provided for the dualpurpose of providing a braking (or negative) torque to control thedescent of the rod system and simultaneously converting the kineticenergy of the downward moving rod system into electrical power. Thus,the pumpjack is able to recapture at least a portion of its power drawfrom the grid as it operates according to the various tuning andmonitoring techniques described in the present disclosure.

One or more aspects of the present disclosure are based on a realizationthat the timing of the stroke cycle of the pump 110 can be dynamicallyadjusted via the controller 128 without physically altering the pumpjackcomponents discussed above (e.g., the gearbox 120, the piloting shaft122, and the crank 123). For example, the controller 128 can provide amotor speed profile to the VFD 126 that includes a plurality of varyingtarget motor speeds corresponding to each of a plurality of discretecontrol periods within a pump stroke cycle. In some embodiments, themotor speed profile may be determined by the controller 128 so as toimprove the production of fluid from the pump 110. In some embodiments,the motor speed profile may be determined by the controller 128 so as tomitigate or decrease the risk of pump-off (a condition where the lowerportion of the pump barrel is not filled with fluid during the upstroke,causing the plunger to pound into the fluid during the downstroke, whichsends a damaging shockwave through the rod system), high stress orfatigue load limits in the rod system (e.g., the polish and suckerrods), and/or high torque in the gearbox.

In some embodiments, the controller 128 determines an appropriate motorspeed profile in response to feedback received during a previous strokecycle of the pump 110 from one or more sensors distributed across thepumpjack 100. In this example, the pumpjack 100 includes a load cellsensor 130, a crank rotation sensor 132, and a motor shaft positionsensor 134 (each of which is depicted schematically in FIG. 1). The loadcell sensor 130 (e.g., a strain gauge) provides a feedback signalproportional to the load carried by the polish rod 108. The crankrotation sensor 132 provides a feedback signal corresponding to theangular position of the crank 123 coupling the gearbox 120 to thepiloting shaft 122. In some embodiments, the crank rotation sensor 132includes a traveling magnet attached to the counterweight 124 carried bythe crank 123 and a stationary transducer mounted to the gearbox 120 orthe base 112. The transducer is responsive to the lines of magnetic fluxeffected by the traveling magnet, so that a signal is generated at eachfull 360° rotation of the counterweight 124.

FIG. 2 illustrates a graph 200 plotting polish rod position versus timeillustrates a default stroke timing curve 202 and an adjusted stroketiming curve 204. The polish rod position data may be captured directlyby a polish rod displacement sensor, or calculated based on feedbackfrom the motor shaft position sensor 134 for the given geometry of thegearbox 120, crank 123 and other pumpjack components. The default stroketiming curve 202 is representative of a pumpjack where the prime moveris operated at constant speed. The default stroke timing curve 202resembles a sinusoidal wave pattern, exhibiting a smooth repetitiveoscillation between the upstroke and the downstroke, which are equal induration. The adjusted stroke timing curve 204 is a modified version ofthe default stroke timing curve 202, and is representative of a pumpjackin accordance with one or more embodiments of the present disclosure,where the prime mover is controlled according to a motor speed profileincluding a plurality of varying target motor speeds within the strokecycle. In this example, the adjusted stroke timing curve 204demonstrates that that the prime mover is slowed down during theupstroke and sped up during the downstroke. As illustrated in the graph200, the result, relative to the default stroke timing curve 202, is anincreased upstroke time and a decreased downstroke time. The increasedupstroke time increases the volumetric efficiency of the pump, becausethere is more time for the pump barrel to refill with fluid from thereservoir. Furthermore, slowing the prime mover, and therefore the pumpplunger, during the upstroke may also increase the stroke length of thepump by allowing the elastic sucker rod to recover from stretchingduring the downstroke and potentially contract near the top of theupstroke. The amount of time added to the upstroke is compensated for bythe decreased downstroke time.

As illustrated in the graph 200, the adjusted stroke timing curve 204has the same duration as the default stroke timing curve 202. Thus, theadjusted stroke timing curve 204 provides an increase in pumpingefficiency without affecting the overall “pumping rate” (by “pumpingrate” we refer to the number of pump stroke cycles executed in a giventime period—e.g., strokes per minute (SPM)). The increase in pumpefficiency and pump stroke length combined with a constant pumping rateresults in an increased fluid production rate. The fluid production rateis typically measured in units of barrels of fluid per day (BFPD). Insome embodiments, such as described below, the downstroke time may beeven further decreased to increase the pumping rate relative to thedefault stroke timing curve and further increase the fluid productionrate.

Referring next to FIG. 3, a sequential diagram 300 (illustratedgraphically at FIGS. 9A-9C) demonstrates that a default motor speedprofile 302 can be adapted by a motor speed adjustment table 304 toprovide an adjusted motor speed profile 306. As described above, a motorspeed profile includes a plurality of target motor speeds correspondingto each of a plurality of discrete control periods within a pump strokecycle. In this example, the motor speed profiles include one-hundredcontrol periods, each of which represents between about 5 and 100milliseconds (e.g., between about 10 and 70 milliseconds, such as about30 milliseconds or about 50 milliseconds) of the stroke cycle. However,other suitable configurations are also envisioned within the scope ofthe present disclosure (e.g., the number of control periods per cyclemay be greater than or less than one-hundred, the number of controlperiods and/or the time duration of each control period may vary betweencycles, etc.). The default motor speed profile 302 is representative ofa pumpjack where the prime mover that is operated at constant speed ofabout 1,100 RPM. Thus, the target motor speed for each of the controlperiods of the default motor speed profile 302 is set to 1,100 RPM. Incontrast to the default motor speed profile 302, the adjusted motorspeed profile 306 includes a varying array of target motor speeds,ranging from 1,060 RPM to 1,170 RPM, distributed over the respectiveone-hundred control periods. The varying target motor speeds of theadjusted motor speed profile 306 are determined by modifying the defaultmotor speed profile 302 according to the RPM adjustment values of themotor speed adjustment table 304. In this example, the RPM adjustmentvalues are provided in the form of an array of increment (e.g., +0 to70), decrement (e.g., −0 to −40) and null or zero (i.e., +0) values,each of which corresponds to a respective control period of the strokecycle. Note that the target motor speeds and motor speed adjustmentvalues discussed here with reference to the example of FIG. 3 areprovided for illustrative purposes, and are not meant to limit thepresent disclosure. Various techniques within the scope of the presentdisclosure may produce significantly different results in this regard.

In some embodiments, the RPM adjustment values are determined accordingto a pumpjack optimization algorithm implemented by the controller 128.The pumpjack optimization algorithm may include a tuning mode and amonitoring mode. While operating in the tuning mode, the algorithm maydetermine one or more RPM adjustment values that will improve fluidproduction. While operating in the monitoring mode, the algorithm maydetermine one or more RPM adjustment values that will relieve one ormore detrimental operating conditions (e.g., the onset of pump-off, highstress on the rod system, and/or high torque at the gearbox) detectedbased on sensory feedback.

As discussed above with reference to FIG. 2, the fluid production rateachieved by the pumpjack can be increased relative to a constant RPMprime mover by increasing the upstroke time, and decreasing thedownstroke time. Thus, in some examples, the pumpjack optimizationalgorithm, while operating in the tuning mode, may derive a motor speedadjustment table 304 including RPM adjustment values that decrease oneor more target motor speeds on the upstroke and increase one or moretarget motor speeds on the downstroke. In some examples, the pumpjackoptimization algorithm may be designed to increase fluid production byincreasing the pumping rate—i.e., reducing the duration of the totalstroke cycle (upstroke plus downstroke) to achieve a higher SPM level.Thus, in some examples, the algorithm may derive a motor speedadjustment table 304 including RPM adjustment values that increase thetarget motor speeds on both the upstroke and the downstroke to increasethe number of SPM. In such examples, any loss of pump efficiency and/orpump stroke length from decreasing the upstroke time is more thanovercome by the increased pumping rate, the net result of which is anincreased the fluid production rate.

In some embodiments, one or more of the RPM adjustment values isdetermined based on sensory feedback, such as may be received by thecontroller 128 from the load cell sensor 130, the crank rotation sensor132, and/or the motor shaft position sensor 134 can be used to determinesuitable RPM adjustment values. As noted above, the feedback from thecrank rotation sensor 132 and the motor shaft position sensor 134 can beused to determine the position of the polish rod 108, and feedback fromthe load cell sensor 130 is proportional to the load carried by thepolish rod 108. This position and load data can be used to construct asynthetic surface dynamometer card (e.g., using techniques described inU.S. Pat. No. 4,490,094) representative of loading at the polish rod 108during a stroke cycle. The surface dynamometer card can then betransformed using techniques known to those of skill in the art (such asdescribed in U.S. Pat. No. 3,343,409) into a downhole pump cardrepresentative of loading at the pump 110 during a stroke cycle. Thesurface dynamometer card and the downhole pump card can be used todetect or predict the conditions that are detrimental to pumpjack fluidproduction, such as the onset of pump-off, high stress on the rodsystem, and high torque at the gearbox. Thus, in some examples, thepumpjack optimization algorithm may conduct this type of analysis andappropriately respond by deriving an appropriate motor speed adjustmenttable 304 to relieve the detrimental condition by: (1) implementing alimited increment amount of one or more RPM adjustment values; (2)implementing one or more null or zero RPM adjustment values; and/or (3)implementing a decrement for one or more RPM adjustment values.

The graph 400 of FIG. 4 demonstrates how a surface dynamometer card 402and/or a downhole pump card 404 can be used to detect the onset of apump-off during a pump stroke cycle. As shown, each of the cards 402 and404 reflects a noticeable inward curvature 406 a, 406 b (sometimesreferred to as a “compression curve”) when a significant amount of gasis compressed during the upstroke. The detection of gas compression inthe downstroke means that the pump barrel is not completely filling withfluid during the upstroke. A slight compression curve (406 a) maysuggest that pump-off is imminent, and a severe compression curve (406b) may suggest that pump-off is presently occurring. Pump-off generallyoccurs when the upstroke timing is too fast, preventing the pump barrelfrom refilling to an acceptable level and causing the plunger to poundinto the fluid column on the downstroke. Pump-off may be relieved byimplementing a decrement for one or more RPM adjustment values duringthe upstroke to slow down the prime-mover RPM and increase the upstroketime. One or more increment RPM adjustment values may be used on thedownstroke to compensate for the increase in upstroke time.

The graph 500 of FIG. 5 demonstrates how a surface dynamometer card 502can be used to detect a “binding” (e.g., a point at which the sucker rodis encountering interference from pipe or casing joints within thewellbore) in the rod system during a pump stroke cycle. A binding of therod system may be exhibited on the surface dynamometer card 502 as asharp increase in rod load 504 a along the upstroke and a sharp decreasein rod load 504 b along the downstroke of the stroke cycle. Similar to afluid pounding event experienced during a pump-off condition, a rodbinding may cause damage to the rod system over time. In some examples,a rod binding may be relieved by appropriately adjusting the stroketiming of the pumpjack. For example, one or more RPM adjustment valuesmay be determined to slow down the sucker rod speed or lower itsacceleration at or near the point within the wellbore where the bindinghas occurred. Such modifications to the stroke timing may be implementedimmediately during the stroke cycle following detection or progressivelyover a serious of subsequent stroke cycles.

The graph 600 of FIG. 6 demonstrates how a surface dynamometer card 602a-d can be used to detect that the sucker rod is being subjected toloads approaching one or more predetermined load and/or stress limitsduring a pump stroke cycle. Interpretation of the surface dynamometercard 602 a-d for rod loading may include identification of the peakmaximum rod load 604, the peak minimum rod load 606, and the difference608 between these values. The peak maximum rod load 604 is observed nearthe beginning of the upstroke. The peak maximum rod load 604 can becompared to a predetermined maximum allowable rod load to identify anexisting or imminent overloading event (see card 602 d) that may causethe rod system to experience tensile failure (e.g., fracturing). Thepeak minimum rod load 606 is observed near the beginning of thedownstroke. The peak minimum rod load 608 may be monitored with respectto the zero load level, at which point the rod system is essentially infreefall (see card 602 d), and therefore susceptible to buckling. Thedifference 608 between the peak maximum rod load 604 and the peakminimum rod load 606 is proportional to the rod fatigue stress. Fatiguefailures are progressive and begin as small stress cracks that growunder the action of cyclic stresses. Thus, the rod fatigue stress canalso be monitored with respect to a predetermined limit value.Overloading and freefall can be relieved by implementing a decrement forone or more RPM adjustment values during the upstroke and/or thedownstroke.

The graph 700 of FIG. 7 demonstrates how a surface dynamometer card 702a-c can be used to detect that the gearbox is being subjected to loadsapproaching one or more predetermined torque limits during a pump strokecycle. Interpretation of the surface dynamometer card 702 a-c forgearbox torque may include monitoring the rod load with respect to anupstroke torque limit curve 704 and a downstroke torque limit curve 706.The torque limit curves 704 and 706 represent the rod loads plotted as afunction of rod position that causes the net torque at the gearbox(which may be considered as the torque caused by the well loads actingon the polish rod discounted by the torque caused by the counterweightacting on the crank) to exceed a predetermined maximum limit.Overtorquing the gearbox can be relieved by implementing a decrement forone or more RPM adjustment values during the upstroke and/or thedownstroke.

In some embodiments, the tuning mode and/or the monitoring mode of thepumpjack optimization algorithm may include an iterative process forprogressively improving pumpjack performance. In some examples, theiterative process may proceed continuously over a sequence of two ormore adjacent pump stroke cycles. So, one or more of the above-describedtechniques may be repeated through multiple iterations to graduallyincrease fluid production. FIG. 8 illustrates a graph 800 including amotor RPM curve 802, a rod load curve 804, and a stroke timing curve806, which demonstrates an interactive tuning process such as may beimplemented by the pumpjack optimization algorithm. In particular, thegraph 800 is illustrative of how the operations of a pumpjack can beprogressively tuned through successive adjustments of the motor speedprofile applied to the prime mover. In Stroke Cycle 1, the prime moveris operated according to a default motor speed profile having constantspeed. In Stroke Cycle 2, the motor speed profile is adjusted toincrease and decrease motor RPM at specific points of the upstroke anddownstroke. The RPM adjustments applied during Stroke Cycle 2 may bederived at least partially based on sensory feedback received duringStroke Cycle 1. In Stroke Cycle 3, the motor speed profile is modifiedyet again based at least in part on sensory feedback received during theprevious stroke cycles. As discussed above, sensory feedback can be usedto detect or predict detrimental operating conditions that may berelieved or inhibited by appropriate RPM adjustments in the subsequentmotor speed profile. However, sensory feedback may also be usedfacilitate the derivation of RPM adjustment values that are likely toincrease fluid production. For example, the surface dynamometer card andthe downhole pump card can be monitored during the tuning process toidentify specific control periods within the motor speed profile wherean appropriate RPM adjustment (e.g., a decrement or increment) is likelyto result in increased pump efficiency and/or increased pump strokelength. In some embodiments, the RPM adjustments may be determined basedon historical data from previous operations of the current pumpjack or asimilarly designed pumpjack. Such historical data may outline thegeneral profile of a previously identified high-production and stablemotor speed profile. Thus, the pumpjack optimization algorithm mayinitially implement suitable RPM adjustments to approach the historicalmotor speed profile. Deviations from the historical motor speed profilemay occur over time based on current sensory feedback.

In some embodiments, iterative tuning of the pumpjack may take placeover several stroke cycles. In some examples, RPM adjustments to themotor speed profile may be conducted in successive cycles of the tuningprocess, such as shown in the graph 800 of FIG. 8. Such RPM adjustmentsmay be relatively small (e.g., within the range of +10 RPM and −10 RPM)in some cases, so as to maintain system stability and prevent damagefrom unforeseen detrimental operating conditions. In some examples, RPMadjustments to the motor speed profile may be conducted piecemeal, withone or more intervening stroke cycles occurring therebetween. Forexample, RPM adjustments to increase fluid production may be implementedaccording to predetermined intervals (e.g., every 10 stroke cycles). Theintervening stroke cycles can be monitored to detect the onset of anypotential adverse operating conditions. In any event, the controller 128may cease the iterative tuning process when it is determined that themotor speed profile has been optimized. For example, the controller 128may determine that the motor speed profile has been optimized whensubsequent adjustments no longer provide significant improvements influid production and/or when subsequent adjustments cannot beimplemented without introducing an adverse operating condition (e.g.,when further incrementing RPM adjustments will result in overtorquing ofthe gearbox).

The graphs of FIGS. 9A-9E provide yet another illustration of aniterative tuning process that may take place over multiple cycles of apumpjack. In this example, the tuning process may be conducted accordingto the technique described above with reference to FIG. 3, where a motorspeed profile can be adjusted based on a motor speed adjustment table.Accordingly, the graph 900 a illustrates a default motor speed curve 902where the target motor speed for each control period of the cycle is setto a constant speed of 1,100 RPM. The graph 900 b illustrates a firstmotor speed adjustment curve 904 representative of a varying array ofincrement (e.g., +0 to 70), decrement (e.g., −0 to −40) and null (i.e.,+0) values, each of which corresponds to a respective control period ofthe cycle. The graph 900 c illustrates a first adjusted motor speedcurve 906 overlaying the default motor speed curve 902. As shown, thefirst adjusted motor speed curve 906 represents a varying array oftarget motor speeds, ranging from 1,060 RPM to 1,170 RPM, distributedover the respective the control periods of the cycle. As discussedabove, the first adjusted motor speed curve 906 is provided by applyingthe increment, decrement, and null values of the first motor speedadjustment curve 904 to the default motor speed curve 902. Thus, thefirst adjusted motor speed curve 906 features one or more target motorspeeds greater than the default 1,100 RPM and one or more target speedsless than the default. The graph 900 d illustrates a second motor speedadjustment curve 908 having increment and decrement values that rangebetween +25 RPM and −20 RPM. And the graph 900 e illustrates a secondadjusted motor speed curve 910 representing a varying array of targetmotor speeds ranging from 1,065 RPM to 1,191 RPM. The second adjustedmotor speed curve 910 is provided by applying the respective adjustmentvalues from the second motor speed adjustment curve 908 to the firstadjusted motor speed curve 906. Thus, the second adjusted motor speedcurve 910 is a second order iteration of the default motor speed curve902.

This iterative tuning process, while demonstrated across two pump strokecycles in this example, may be repeated any number of times to achievean optimized motor speed profile. As noted above, such adjustments ofthe motor speed profile may be conducted across successive cycles orbetween one or more intervening cycles. The first and second motor speedadjustment curves 902 and 908 may be derived according to any suitablealgorithm for improving fluid production, such as those described aboveinvolving increased pump efficiency, increased pumping rate, as well aspreventing, relieving or mitigating detrimental operating conditionsusing sensory feedback. Furthermore, a similar process may be performedto adjust the motor speed profile during a monitoring mode. For example,the controller may detect one or more detrimental operating conditionsbased on sensory feedback and derive an appropriate motor speedadjustment curve to relieve the condition. In some embodiments, after adetrimental condition detected during the monitoring mode has beenrelieved, the pumpjack controller may re-enter the tuning mode in anattempt to improve fluid production.

FIGS. 10-12 and 14 illustrate processes 1000, 1100, 1200 and 1400 foroperating a pumpjack. These processes can be implemented, for example,in connection with one or more components of the pumpjack 100,particularly the controller 128 and/or the VFD 126. Further, theoperations of the processes do not require the any particular order toachieve desirable results. In addition, other operations may beprovided, or operations may be eliminated, from the described processeswithout departing from the scope of the present disclosure.

According to the process 1000 of FIG. 10, an electric motor driving thepumpjack is operated (1002) in a first pump stroke cycle according to afirst motor speed profile. The first motor speed profile includes aplurality of target motor speeds, each of which corresponds to arespective discrete control period within the first pump stroke cycle.In some embodiments, the first motor speed profile may be apredetermined default setting (e.g., a constant RPM pattern), or analtered version of a motor speed profile utilized in a previous pumpstroke cycle. Sensory feedback is received (1004) during the first pumpcycle from one or more sensors mounted to monitor the operations of thepumpjack. The sensory feedback includes data collected during operationof the motor according to the first motor speed profile. In someembodiments, the sensory feedback may be received from one or more of aload cell sensor, a crank rotation sensor, and a motor shaft positionsensor. One or more speed adjustment values corresponding to a limitedsubset of the plurality of control periods are determined (1006) inresponse to receiving the sensory feedback, and while continuing tooperate the pumpjack. In some embodiments, the speed adjustment valuesmay be determined by constructing a data structure relating position toload with respect to the rod system of the pumpjack (e.g., a surfacedynamometer card and/or a downhole pump card), and comparing the datastructure to one or more predetermined load limits (e.g., a maximum rodload, a minimum rod load, an upstroke torque load limit, and adownstroke torque load limit) to identify an adverse operating condition(e.g., the onset of pump-off, high stress on the rod system, and hightorque at the gearbox). In some embodiments, the speed adjustment valuesmay be determined by identifying an abrupt load spike indicative of arod binding. In some embodiments, the speed adjustment values mayinclude a decrement to decrease the target motor speed at a controlperiod where an adverse operating condition is likely to reoccur, or atan earlier control period. Decreasing motor speed at or before thecontrol period where the adverse operating condition is likely toreoccur may relieve the condition. In some embodiments, the speedadjustment values may include an increment to increase the target motorspeed at a control period where an adverse operating condition is notlikely to reoccur. Increasing motor speed at a different point in thestroke cycle may increase the pumping rate, without aggravating orre-initiating the adverse operating condition. The first motor speedprofile is adjusted (1008) based on the one or more speed adjustmentvalues to provide a second motor speed profile. And the electric motoris operated (1010) over a second pump stroke cycle, which is immediatelysubsequent to the first pump stroke cycle, in accordance with the secondmotor speed profile.

According to the process 1100 or FIG. 11, an electric motor driving thepumpjack is operated (1102) according to a predetermined motor speedprofile. The motor speed profile includes a plurality of target motorspeeds, each of which corresponds to a respective control period withina stroke cycle of the pumpjack. Sensory feedback is received (1104) asthe motor is operated during the stroke cycle from one or more sensorsmounted to monitor the operations of the pumpjack (e.g., a load cellsensor, a crank rotation sensor, and/or a motor shaft position sensor).While continuing to operate (1102) the electric motor and receive (1104)sensory feedback, selected target motor speeds are incrementallyincreased (1106) over a plurality of sequential stroke cycles until anadverse operating condition (e.g., the onset of pump-off, high stress onthe rod system, and high torque at the gearbox) is detected (1108) basedon the sensory feedback. In response to detecting (1108) the adverseoperating condition, a select subset of the plurality of target motorspeeds are decreased (1110) based on a position of the detected adverseoperating condition within the stroke cycle. In some embodiments, theselect subset of the plurality of target motor speeds may include one ormore target motor speeds at or before the control where the adverseoperating condition is likely to reoccur.

According to the process 1200 of FIG. 12, an electric motor driving thepumpjack is operated (1202) according to a predetermined motor speedprofile. The motor speed profile includes a plurality of target motorspeeds corresponding to each of a plurality of discrete pump strokecycle segments (e.g., discrete control periods). Load data is received(1204) from one or more sensors (e.g., a load cell sensor) mounted tomonitor operations of the pumpjack. A pump cycle load profile is stored(1206) in computer memory and updated (1208) over a period of severalpump stroke cycles based on the received load data. And, in response todetecting (1210) that current load data has deviated from the historicalload profile by more than a predetermined deviation threshold, a subsetof the plurality of the target motor speeds are automaticallydecremented (1212). The target motor speeds to be decremented areselected based on the position of the deviating load data within thestroke cycle. The detected load data deviation may be indicative of anadverse operating conditions such as a rod binding, pump-off, highstress on the rod system, and high torque at the gearbox.

As described in detail above, the prime mover of a pumpjack may beoperated according to varying motor speed profile to improve fluidproduction and prevent or inhibit certain adverse operating conditions.The motor speed profile includes a plurality of target motor speedscorresponding to each of a plurality of discrete control periods withinthe stroke cycle. The VFD regulates the speed and torque output of thepumpjack motor by varying input frequency and voltage. In someembodiments, a controller coupled to the VFD can be configured (e.g.,appropriately programmed) to implement a dynamic torque controltechnique where the torque of the motor is adapted to meet, but notexceed (at least beyond a predetermined safety margin), the loadrequirements for operation at the prescribed motor speed for eachcontrol period of the current stroke cycle. The voltage applied createsthe potential for torque within the motor. Thus, the applied voltage maybe reduced according to a reduction in torque required by the motor. Insome examples, the voltage required may be accurately predicted andregulated based upon historical pump cycle data, allowing for preventionof stall conditions (i.e., where the motor is starved of torque) andoptimization of the efficiency of the motor by applying only the voltagerequired to deliver that torque. Accordingly, decreased energyconsumption may be achieved by using dynamic torque control. The graph1300 of FIG. 13 illustrates a dynamic motor torque curve 1302 and amotor voltage curve 1304 applied to provide the required torque at eachpoint in the stroke cycle.

According to the process 1400 of FIG. 14, an electric motor driving thepumpjack is operated (1402) according to a varying motor speed profile.The motor speed profile includes a plurality of target motor speedscorresponding to each of a plurality of discrete pump stroke cyclesegments (e.g., discrete control periods). Load data is received (1404)from one or more sensors (e.g., a load cell sensor) mounted to monitoroperations of the pumpjack. A pump cycle load profile is stored (1406)in computer memory based on the received load data. A varying voltageprofile is automatically determined (1408) to drive the electric motoraccording to the plurality of target motor speeds and the pump cycleload profile. And the varying voltage profile is subsequently applied(1410) to the motor. Further, in some embodiments, a dynamic torquecontrol technique may be conducted predictively on a cycle-by-cyclebases. That is, the pump cycle load profile (e.g., the dynamic motortorque curve) can be mathematically predicted based on an altered motorspeed profile to be implemented during the upcoming pump stroke cycle.The predicted pump cycle load profile can then be used to determine apredicted varying voltage profile. The altered motor speed profile andthe predicted varying voltage profile can be simultaneously implementedduring the next pump stroke cycle. This predictive technique wouldnormally be dangerous to implement in a highly variable torqueenvironment, because a large increase in the torque requirement on themotor cannot be predicted by a conventional control system. However, inone or more embodiments of the present disclosure, the pump cycle loadprofile can be accurately determined (e.g., mathematically predicted)based at least in part on historical sensory feedback data and/oradjustments between the current motor speed profile and one or morestroke timing curves implemented during one or more previous cycles.

The graph 1500 of FIG. 15 demonstrates how a surface dynamometer card1502 a can be adjusted over one or more pump stroke cycles to increasefluid production while avoiding the predetermined gearbox torque limits1504 and 1506. As discussed above with reference to FIG. 7, overtorquingthe gearbox can be prevented or relieved by implementing a decrement forone or more RPM adjustment values during the upstroke and/or thedownstroke. However, decreasing the motor RPM to remedy or preventdamage to the gearbox can have a detrimental effect on the fluidproduction rate. Thus, in order to maintain (or even increase) the rateof fluid production, one or more increments RPM adjustment values may beimplemented at other regions of the stroke cycle that are notstructurally limited by the torque limits. The surface dynamometer card1502 b illustrates two regions of the stroke cycle 1508 a, 1508 b wherethe motor RPM is decreased to avoid the torque limits, and two otherregions 1508 c, 1508 d where the motor RPM is increased to make up forthe motor speed decrease. In this way, the stroke cycle can be furtheroptimized via a strategically alteration of the surface dynamometer cardto effectively redistribute the gearbox torque. Similar techniques foraltering the surface dynamometer card can be implemented with respect tothe peak maximum and peak minimum rod loads described above withreference to FIG. 6 and/or the detection of a rod binding describedabove with reference to FIG. 5, with the effect of preventing or curinga rod stress condition while increasing fluid production.

A number of embodiments of the invention have been described.Nevertheless, it will be understood that various modifications may bemade without departing from the spirit and scope of the inventions.

What is claimed is:
 1. A method of operating a pumpjack continuouslyover a sequence of pump stroke cycles, the method comprising: energizingan electric motor to operate the pumpjack over a first pump strokecycle, according to a first motor speed profile comprising a pluralityof target motor speeds corresponding to each of a plurality of discretecontrol periods within the first pump stroke cycle; receiving sensoryfeedback during the first pump stroke cycle from one or more sensorsmounted to monitor at least one operating condition of the pumpjack, thesensory feedback comprising data collected during operation of the motoraccording to the first motor speed profile; detecting, while continuingto operate the pumpjack, a detrimental operating condition within thefirst pump stroke cycle based on the sensory feedback; in response todetecting the detrimental operating condition, determining one or morespeed adjustment values corresponding to a limited subset of theplurality of discrete control periods; altering the first motor speedprofile based on the one or more adjustment values to provide a secondmotor speed profile; and operating the electric motor over a second pumpstroke cycle, according to the second motor speed profile.
 2. The methodof claim 1, wherein the first motor speed profile comprises apredetermined default setting.
 3. The method of claim 1, wherein thefirst motor speed profile comprises an altered version of a motor speedprofile utilized in a previous pump stroke cycle of the sequence.
 4. Themethod of claim 1, wherein the plurality of discrete control periods ofthe first pump stroke cycle comprise at least 100 control periods. 5.The method of claim 1, wherein one or more of the plurality of discretecontrol periods of the first pump stroke cycle comprise a time durationof between about 5 and 100 milliseconds.
 6. The method of claim 1,wherein each of the plurality of discrete control periods of the firstpump stroke comprise an identical time duration.
 7. The method of claim1, wherein at least one of the sensors comprises a load sensor.
 8. Themethod of claim 7, wherein the load sensor is responsive to load of apolish rod of the pumpjack.
 9. The method of claim 1, wherein at leastone of the sensors comprises a crank rotation sensor.
 10. The method ofclaim 1, wherein at least one of the sensors comprises a motor shaftposition sensor.
 11. The method of claim 1, wherein at least one of thesensors comprises a motor current sensor.
 12. The method of claim 1,wherein detecting the detrimental operating condition comprisesconstructing a data structure relating position to load with respect toa polish rod of the pumpjack over the first pump stroke cycle based onthe sensory feedback.
 13. The method of claim 12, wherein detecting thedetrimental operating condition comprises comparing the data structureto one or more predetermined load limits.
 14. The method of claim 13,wherein at least one of the predetermined load limits corresponds tostructural integrity of the polish rod.
 15. The method of claim 12,wherein at least one of the predetermined load limits corresponds tostructural integrity of a gear box coupled to the motor and the polishrod.
 16. The method of claim 12, wherein detecting the detrimentaloperating condition further comprises identifying an abrupt load spikebased on the data structure.
 17. The method of claim 12, wherein thedata structure comprises a dynamometer surface card.
 18. The method ofclaim 12, wherein the data structure comprises a downhole pump card. 19.The method of claim 1, wherein determining the one or more speedadjustment values comprises selecting a speed adjustment value toincrease the target motor speed at a control period within the secondpump stroke cycle preceding or subsequent to a different control periodwhere the detrimental operating condition is likely to reoccur.
 20. Themethod of claim 1, wherein determining the one or more speed adjustmentvalues comprises selecting a speed adjustment value to decrease thetarget motor speed at a control period within the second pump strokecycle where the detrimental operating condition is likely to reoccur.21. The method of claim 1, wherein determining the one or more speedadjustment values comprises selecting a speed adjustment value todecrease the target motor speed at a control period within the secondpump stroke cycle preceding a different control period where thedetrimental operating condition is likely to reoccur.
 22. The method ofclaim 1, wherein the electric motor comprises a regenerative drive, andwherein the method further comprises providing a breaking torque tocontrol descent of a rod system of the pumpjack during a downstroke ofeach of the pump stroke cycles, while simultaneously converting kineticenergy of the rod system into electrical power.
 23. A method ofoperating a pumpjack, the method comprising: operating an electric motorof a pumpjack to pump fluid, according to a predetermined motor speedprofile comprising a plurality of target motor speeds corresponding toeach of a plurality of discrete control periods within a stroke cycle ofthe pumpjack, while receiving sensory feedback comprising data collectedfrom one or more sensors mounted to monitor at least one operatingcondition of the pumpjack, wherein the predetermined motor speed profilecorresponds to an optimized stroke timing curve determined during one ormore previous stroke cycles of the pumpjack; while continuing to operatethe electric motor to pump fluid, increasing one or more of theplurality of target motor speeds over a plurality of stroke cycles untila detrimental operating condition is detected based on sensory feedback;and in response to detecting the detrimental operating condition, and asthe pumpjack continues to pump fluid, decreasing a subset of theplurality of target motor speeds selected based on a position of thedetected detrimental operating condition within the stroke cycle. 24.The method of claim 23, wherein the plurality of discrete controlperiods comprises at least 100 control periods.
 25. The method of claim23, wherein one or more of the plurality of discrete control periodscomprise a time duration of between about 5 and 100 milliseconds. 26.The method of claim 23, wherein each of the plurality of discretecontrol periods comprise an identical time duration.
 27. The method ofclaim 23, wherein at least one of the sensors comprises a load sensor.28. The method of claim 27, wherein the load sensor is responsive toload of a polish rod of the pumpjack.
 29. The method of claim 23,wherein at least one of the sensors comprises a crank rotation sensor.30. The method of claim 23, wherein at least one of the sensorscomprises a motor shaft position sensor.
 31. The method of claim 23,wherein at least one of the sensors comprises a motor current sensor.32. The method of claim 23, wherein incrementally increasing selectedones of the plurality of target motor speeds comprises incrementallyincreasing each of the plurality of target motor speeds according to apredetermined adjustment schedule.
 33. The method of claim 23, whereinthe detrimental operating condition is detected by: constructing a datastructure relating position to load with respect to a polish rod of thepumpjack over the stroke cycle based on the sensory feedback; andcomparing the data structure to one or more predetermined load limits.34. The method of claim 33, wherein at least one of the predeterminedload limits corresponds to structural integrity of the polish rod. 35.The method of claim 33, wherein at least one of the predetermined loadlimits corresponds to structural integrity of a gear box coupled to themotor and the polish rod.
 36. The method of claim 23, wherein thedetrimental operating condition is detected by: constructing a datastructure relating position to load with respect to a polish rod of thepumpjack over the stroke cycle based on the sensory feedback; andidentifying an abrupt load spike based on the data structure.
 37. Themethod of claim 23, wherein decreasing a subset of the plurality oftarget motor speeds comprises decreasing the target motor speed at oneor more control periods preceding a different control period where thedetrimental operating condition is likely to reoccur.
 38. The method ofclaim 23, wherein decreasing a subset of the plurality of target motorspeeds comprises decreasing the target motor speed at the control periodwhere the detrimental operating condition is likely to reoccur.
 39. Themethod of claim 23, wherein the electric motor comprises a regenerativedrive, and wherein the method further comprises providing a breakingtorque to control descent of a rod system of the pumpjack during adownstroke of each of the pump stroke cycles while simultaneouslyconverting kinetic energy of the rod system into electrical power.
 40. Apumpjack motor system, comprising: an electric motor coupled to a gearbox of a pumpjack; one or more sensors mounted to monitor at least oneoperating condition of the pumpjack; and a local controller coupled tothe electric motor and the one or more sensors and operable, while thepumpjack continuously pumps fluid, to: control the motor according to afirst motor speed profile comprising a plurality of target motor speedscorresponding to each of a plurality of discrete control periods withina single stroke cycle of the pumpjack; receive sensory feedback from theone or more sensors, the sensory feedback comprising data, includingload data, collected during operation of the motor according to thefirst motor speed profile; automatically increment a first set of thetarget motor speeds corresponding to portions of the stroke cycleoutside of a predetermined load limit, based on the load data; andautomatically decrement a second set of the target motor speedscorresponding to portions of the stroke cycle within the predeterminedload limit, thereby generating a second motor speed profile; and tocontrol the motor according to the second motor speed profile.
 41. Thepumpjack motor system of claim 38, wherein at least one of the sensorscomprises a load sensor.
 42. The pumpjack motor system of claim 41,wherein the load sensor is responsive to load of a polish rod of thepumpjack.
 43. The pumpjack motor system of claim 40, wherein at leastone of the sensors comprises a crank rotation sensor.
 44. The pumpjackmotor system of claim 41, wherein at least one of the sensors comprisesa motor shaft position sensor.
 45. The pumpjack motor system of claim40, wherein at least one of the sensors comprises a motor currentsensor.
 46. The pumpjack motor system of claim 40, wherein thecontroller is further configured to identify portions of the strokecycle outside of the predetermined load limit by: constructing a datastructure relating position to load with respect to a polish rod of thepumpjack over the stroke cycle based on the sensory feedback; andcomparing the data structure to the predetermined load limit.
 47. Thepumpjack motor system of claim 40, wherein the predetermined load limitcorresponds to structural integrity of the polish rod.
 48. The pumpjackmotor system of claim 40, wherein the predetermined load limitcorresponds to structural integrity of a gear box coupled to the motorand the polish rod.
 49. The pumpjack motor system of claim 40, whereinthe electric motor comprises a regenerative drive configured to providea breaking torque to control the descent of a rod system of the pumpjackduring a downstroke of each stroke cycle, while simultaneouslyconverting kinetic energy of the rod system into electrical power.
 50. Apumpjack motor system, comprising: an electric motor coupled to a gearbox of a pumpjack; one or more sensors mounted to monitor at least oneoperating condition of the pumpjack; and a local controller coupled tothe electric motor and the one or more sensors and operable, while thepumpjack continuously pumps fluid over two sequential pumping cycles,to: control the electric motor through a first of the two sequentialpumping cycles, according to a first motor speed profile comprising aplurality of target motor speeds corresponding to respective portions ofthe pumpjack stroke cycle, while receiving sensory feedback from the oneor more sensors; detect a detrimental operating condition within thefirst pump stroke cycle based on the sensory feedback; in response tothe detection, automatically adjust one or more of the target motorspeeds as a function of the sensory feedback, to generate an adjustedmotor speed profile; and to control the motor according to the adjustedmotor speed profile during a second of the two sequential pumping cyclesof the pumpjack.
 51. The pumpjack motor system of claim 50, wherein thefirst motor speed profile comprises a predetermined default setting. 52.The pumpjack motor system of claim 50, wherein the first motor speedprofile comprises an altered version of a motor speed profile utilizedin a previous pump stroke cycle of the sequence.
 53. The pumpjack motorsystem of claim 50, wherein at least one of the sensors comprises a loadsensor.
 54. The pumpjack motor system of claim 53, wherein the loadsensor is responsive to load of a polish rod of the pumpjack.
 55. Thepumpjack motor system of claim 50, wherein at least one of the sensorscomprises a crank rotation sensor.
 56. The pumpjack motor system ofclaim 50, wherein at least one of the sensors comprises a motor shaftposition sensor.
 57. The pumpjack motor system of claim 50, wherein atleast one of the sensors comprises a motor current sensor.
 58. Thepumpjack motor system of claim 50, wherein the local controller isoperable to detect the detrimental operating condition by firstconstructing a data structure relating position to load with respect toa polish rod of the pumpjack over the first pump stroke cycle based onthe sensory feedback.
 59. The pumpjack motor system of claim 58, whereinthe local controller is operable to detect the detrimental operatingcondition by also comparing the data structure to one or morepredetermined load limits.
 60. The pumpjack motor system of claim 59,wherein at least one of the predetermined load limits corresponds tostructural integrity of the polish rod.
 61. The pumpjack motor system ofclaim 59, wherein at least one of the predetermined load limitscorresponds to structural integrity of a gear box coupled to the motorand the polish rod.
 62. The pumpjack motor system of claim 58, whereinthe local controller is operable to detect the detrimental operatingcondition by identifying an abrupt load spike based on the datastructure.
 63. The pumpjack motor system of claim 58, wherein the datastructure comprises a dynamometer surface card.
 64. The pumpjack motorsystem of claim 58, wherein the data structure comprises a downhole pumpcard.
 65. The pumpjack motor system of claim 50, wherein the localcontroller is operable to detect the detrimental operating condition byselecting a speed adjustment value to increase the target motor speed ata control period within the second pump stroke cycle preceding orsubsequent to a different control period where the detrimental operatingcondition is likely to reoccur.
 66. The pumpjack motor system of claim50, wherein the controller automatically adjusts one or more of thetarget motor speeds by selecting a speed adjustment value to decreasethe target motor speed at a control period within the second pump strokecycle where the detrimental operating condition is likely to reoccur.67. The pumpjack motor system of claim 50, wherein the controllerdetermines the one or more speed adjustment values by selecting a speedadjustment value to decrease the target motor speed at a control periodwithin the second pump stroke cycle preceding a different control periodwhere the detrimental operating condition is likely to reoccur.
 68. Thepumpjack motor system of claim 50, wherein the electric motor comprisesa regenerative drive configured to provide a breaking torque to controlthe descent of a rod system of the pumpjack during a downstroke of eachof the stroke cycles, while simultaneously converting kinetic energy ofthe rod system into electrical power.
 69. A method of pumping fluid, themethod comprising: operating an electric motor of a pumpjack to pumpfluid, according to a predetermined motor speed profile comprising aplurality of target motor speeds corresponding to each of a plurality ofdiscrete pump stroke cycle segments, while receiving load data from oneor more sensors mounted to monitor at least one operating condition ofthe pumpjack; storing and updating a pump stroke cycle load profilebased on the received load data over a period of several pump strokecycles; and in response to detecting load data deviating from the loadprofile by more than a predetermined deviation threshold, automaticallydecrementing a subset of the plurality of target motor speeds selectedbased on a position of the deviating load data within the stroke cycle.70. The method of claim 69, wherein the detected load data deviation isindicative of a rod load spike.
 71. The method of claim 69, wherein thedetected load data deviation is indicative of a pump-off condition. 72.The method of claim 69, wherein the detected load data deviation isindicative of a gearbox torque transfer anomaly.
 73. The method of claim69, wherein at least one of the sensors comprises a load sensor.
 74. Themethod of claim 73, wherein the load sensor is responsive to load of apolish rod of the pumpjack.
 75. The method of claim 69, wherein at leastone of the sensors comprises a crank rotation sensor.
 76. The method ofclaim 69, wherein at least one of the sensors comprises a motor shaftposition sensor.
 77. The method of claim 69, wherein at least one of thesensors comprises a motor current sensor.
 78. The method of claim 69,wherein the pump stroke cycle load profile comprises a data structurerelating position to load with respect to a polish rod of the pumpjackover one or more of the pump stroke cycles based on the sensoryfeedback.
 79. The method of claim 78, further comprising detecting theload data deviation by comparing the data structure to one or morepredetermined load limits.
 80. The method of claim 79, wherein at leastone of the predetermined load limits corresponds to structural integrityof the polish rod.
 81. The method of claim 79, wherein at least one ofthe predetermined load limits corresponds to structural integrity of agear box coupled to the motor and the polish rod.
 82. The method ofclaim 69, wherein the electric motor comprises a regenerative drive, andwherein the method further comprises providing a breaking torque tocontrol the descent of a rod system of the pumpjack during a downstrokeof the pump stroke cycle, while simultaneously converting kinetic energyof the rod system into electrical power.